home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Online / httpproxy / src / queue.h < prev    next >
C/C++ Source or Header  |  1996-08-20  |  1KB  |  64 lines

  1. /*(( "Header" */
  2. /*
  3.  * $Id: queue.h,v 1.1 1996/07/30 13:57:03 mshopf Exp mshopf $
  4.  *
  5.  * (c) 1995-96 Matthias Hopf
  6.  *
  7.  * Queueing for HttpProxy.
  8.  *
  9.  */
  10.  
  11. /*
  12.  * $Log: queue.h,v $
  13.  * Revision 1.1  1996/07/30  13:57:03  mshopf
  14.  * Initial revision
  15.  *
  16.  *
  17.  */
  18.  
  19.  
  20. /*)) */
  21.  
  22. #ifndef _QUEUE_H__
  23. #define _QUEUE_H__
  24.  
  25. /*(( "Constants" */
  26.  
  27. #define QUEUEFILE "@queue"      /* File name for queue files */
  28.  
  29. #define MAX_QUEUE_NUM 64        /* Maximum total queue length (number of entries) */
  30. #define MAX_QUEUE_LEN 128       /* Maximum size of Urls to be queued */
  31.  
  32. /*)) */
  33. /*(( "Types" */
  34.  
  35. typedef struct {
  36.            char Url [MAX_QUEUE_LEN];
  37.            } queue_t;
  38.  
  39. /*)) */
  40. /*(( "Prototypes" */
  41.  
  42. /* Initialization routine. Get queueing information. */
  43. /* return 0 on major failure */
  44. int      QueueInit (void);
  45.  
  46. /* Clean up and save new queueing information file. */
  47. void     QueueExit (void);
  48.  
  49. /* Check whether a specific Url is already queued. Returns NULL when not queued. */
  50. queue_t *QueueCheck (const char *Url);
  51.  
  52. /* Queue a Url. Returns 0 on failure */
  53. int      QueueQueue (const char *Url);
  54.  
  55. /* Unqueue a Url */
  56. void     QueueUnqueue (queue_t *Queue);
  57.  
  58. /* Get the next queued Url. Start with Last==NULL. Returns NULL when no more Urls are queued. */
  59. queue_t *QueueNext (const queue_t *Last);
  60.  
  61. /*)) */
  62.  
  63. #endif /* _QUEUE_H__ */
  64.